import request from '@/utils/request'

// 平台导出接口
export function getMyPaperList(data) {
  return request({
    url: '/tPlatform/export',
    method: 'post',
    data
  })
}

// 获取平台类别列表
export function getPlatformCategories() {
  return request({
    url: '/tplatformtype/getCascadingData',
    method: 'get'
  })
}

// 平台分页查询接口
export function getUserPlatforms(data) {
  return request({
    url: '/tPlatform/UserGetRelateTPlatform',
    method: 'post',
    data
  })
}

export function platform_add(data) {
  return request({
    url: '/tPlatform/addTPlatform',
    method: 'post',
    data
  })
}

export function platform_delete(id) {
  return request({
    url: '/tPlatform/DeleteTPlatform',
    method: 'get',
    params: { id }
  })
}

export function platform_commit(id, uid) {
  return request({
    url: '/tPlatform/ReCommitTPlatform',
    method: 'get',
    params: { id, uid }
  })
}

// 院级审核
export function get_platform_college(data) {
  return request({
    url: '/tPlatform/UserGetRelateTPlatform',
    method: 'post',
    data
  })
}

// 科研平台-院级通过
export function platform_pass_college(id) {
  return request({
    url: '/tPlatform/CollegeCheckPass',
    method: 'get',
    params: { id }
  })
}

// 科研平台-院级退回
export function platform_back_college(data) {
  return request({
    url: '/tPlatform/CollegeCheckBack',
    method: 'post',
    data
  })
}

export function platform_pass_school(id) {
  return request({
    url: '/tPlatform/SchoolCheckPass',
    method: 'get',
    params: { id }
  })
}

export function platform_back_school(data) {
  return request({
    url: '/tPlatform/SchoolCheckBack',
    method: 'post',
    data
  })
}

// 科研平台-修改
export function platform_update(data) {
  return request({
    url: '/tPlatform/updateTPlatform',
    method: 'post',
    data
  })
}

// 科研平台-名称查重
export function platform_check_name(platformName) {
  return request({
    url: '/tPlatform/ChecktPlatformName',
    method: 'get',
    params: { platformName }
  })
}

// 根据主键科研平台查询
export function get_platform_by_id(id) {
  return request({
    url: '/tPlatform/GetTPlatformById',
    method: 'get',
    params: { id }
  })
}

// 科研平台-校级通过
export function platform_pass_xiaoji(id) {
  return request({
    url: '/tPlatform/SchoolCheckPass',
    method: 'get',
    params: { id }
  })
}

// 科研平台-校级退回
export function platform_back_xiaoji(data) {
  return request({
    url: '/tPlatform/SchoolCheckBack',
    method: 'post',
    data
  })
}

// 科研平台-文件信息上传
export function platform_add_file(data) {
  return request({
    url: '/tplatformfile/addtPlatformfile',
    method: 'post',
    data
  })
}

// 科研平台-文件信息删除
export function platform_delete_file(fileID) {
  return request({
    url: '/tplatformfile/DeletetPlatformfile',
    method: 'get',
    params: { fileID }
  })
}

// 科研平台-文件信息分页查询
export function platform_page_file(id) {
  return request({
    url: '/tplatformfile/pagetPlatformfileCondition',
    method: 'get',
    params: { id }
  })
}

// 院级审核-获取院级平台列表
export function get_platform_yuanji(data) {
  return request({
    url: '/tPlatform/UserGetRelateTPlatform',
    method: 'post',
    data
  })
}

// 科研平台-撤回申报
export function thesis_withdraw(id, uid) {
  return request({
    url: '/tPlatform/WithdrawTPlatform',
    method: 'post',
    params: { id }, // id通过query传递
    data: { uid }, // uid通过form data传递
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}
